package org.sanguine.study.hometasks.first.task.a;

import java.io.PrintWriter;
import java.io.Reader;
import java.io.StringReader;

import org.sanguine.study.hometasks.first.Runner;

public class TaskA9_2 extends TaskA2 {

	public static void main(String[] args) {
		Runner runner = new TaskA9_2();
		runner.run(args);
	}

	@Override
	protected void printUsage() {
		System.out.println("USAGE: java -jar 'task-to-run' 'string1' 'string2' ...");
	}

	@Override
	public boolean setUp(Reader in, PrintWriter out, String[] args) {
		if (args != null && args.length > 0) {
			StringBuffer inBuffer = new StringBuffer();
			for (String s : args) inBuffer.append(s + "\n");
			this.in = new StringReader(inBuffer.toString());
			this.out = out;
			numberOfItems = args.length;
			items = new String[numberOfItems];
		}
		return true;
	}

}
